package cn.jervain.nut.auth.demo.controller

import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/demo")
class DemoController {

    val objectMapper = ObjectMapper()

    /**
     * 公共部分，不需要授权
     */
    @GetMapping("/public")
    fun public(): String {
        return "public"
    }

    /**
     * 需要登陆
     */
    @GetMapping("/auth")
    fun auth(): String {
        return "auth"
    }

    /**
     * 需要有相应的权限
     */
    @GetMapping("/access")
    fun access(): String {
        return "access"
    }


}